import json
import os
class open_json:    
    def get_json_value(self,key,file_name=None):
        if file_name==None:
            path=os.path.dirname(__file__) + "\\return_data.json"
        else:
            path=os.path.dirname(__file__)+file_name
        with open(path) as f:
            data=json.load(f)
        json_value=data[key]
        # 取出某个json对象中的值
        return json_value
oj=open_json()
# print(oj.get_json_value("test456/abc","\\test_data.json"))